<template>
    <div>
        <div v-for="item in goodsDetaile" :key="item.id" class="goodsDesc">
            <h1>{{ item.title }}</h1>
            <hr>
            <div v-html="item.message" class="cont"></div>
        </div>
    </div>
</template>

<script>
import { Toast } from 'mint-ui'
    export default {
        data: function(){
            return {
                id: this.$route.params.id,
                goodsDetaile: []
            }
        },
        created:function(){
            this.getGoodsDetaile()
        },
        methods: {
            getGoodsDetaile: function(){
                this.$http.get('http://127.0.0.1:4000/getGoodsDetaile?id='+this.id).then(res=>{
                    // console.log(res.body)
                    if(res.body.status != 0){
                        return Toast('获取失败')
                    }
                    this.goodsDetaile= res.body.message
                })
            }
        }
    }
</script>

<style lang="scss" >
    .goodsDesc{
        h1 {
            font-size: 18px;
            text-align: center;
            color: #26A2FF;
            line-height: 35px;
             margin-top: 5px;
        }
        .cont {
            p {
                text-indent: 2em;
            }
            img {
                width: 100%;
            }
        }

    }
</style>